<template>
	<view class="jobCard-box">
		<view class="jobCard" @click="jobDetail(item)" v-for="(item,index) in props.list" :key="index">
			<view class="jcName" v-if="showcompnay">
				<image :src="item.companyLogo" mode=""></image>
				<text>{{item.companyName}}</text>
			</view>
			<view class="jcType">
				<text>{{item.jobName}}</text>
				<text v-if="item.comprehensiveSalaryType == 1">{{item.comprehensiveSalaryStart}}-{{item.comprehensiveSalaryEnd}}k ·{{item.bonus}}薪</text>
				<text v-else>面议</text>
			</view>
			<view class="jcAddress">
				<text>{{item.cityName}}-{{item.areaName}}</text>
				<text>全职</text>
			</view>
			<view class="jcContent u-line-2" v-if="pageType !='myInterview'">{{item.jobDescription}}</view>
			<view class="jcTime">{{item.lastTime}}</view>
		</view>
	</view>
	
</template>

<script setup lang="ts">
	import {
		useRouter
	} from 'uni-mini-router'
	let props = defineProps({
		list:{
			type: Array, // 类型
			default:()=>[]// 默认值
		},
		showcompnay:{
			type: Boolean, // 类型
			default: true // 默认值
		},
		pageType:{
			type: String, // 类型
			default: '' // 默认值
		},
	})
	
	const router = useRouter()
	const jobDetail = (item) => {
		router.push({
			name: 'jobDetail',
			params: {
				id:item.id
			}
		})
	}
</script>

<style lang="scss" scoped>
	.jobCard-box{
		// height:100%;
		padding:0 24rpx;
		// overflow-y: auto;
		
	}
	.jobCard {
		width:100%;
		
		// width: calc(92% - 40rpx);
		min-height: 328rpx;
		overflow: hidden;
		box-sizing: border-box;
		border: 2rpx solid #fff;
		margin: 30rpx auto;
		padding: 24rpx;
		background:#fff;
		border-radius: 24rpx;
		box-shadow: 8rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		

		.jcName {
			display: flex;
			align-items: center;
			image {
				width: 50rpx;
				height: 50rpx;
				border-radius: 50rpx;
				margin-right: 20rpx;
			}
			text{
				font-size: 24rpx;
			}
		}

		.jcType {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin: 24rpx 0 24rpx 0;
			
			text:nth-child(1) {
				font-size: 32rpx;
				font-weight: 600;
			}

			text:nth-child(2) {
				font-size: 32rpx;
				color: rgba(203, 100, 94, 1);
				font-weight: 700;
			}
		}

		.jcAddress {
			font-size: 24rpx;
			margin-bottom:12rpx;
			color: rgba(0, 0, 0, 0.45);
			white-space: nowrap;
			line-height: 34rpx;
			
			text{
				font-size:24rpx;
				padding:6rpx 16rpx;
				background:#FAFAFA ;
				margin-right:16rpx;
			}
			
		}

		.jcContent {
			color: rgba(0, 0, 0, 0.65);
			font-size: 28rpx;
			line-height: 44rpx;
			max-height:100rpx;
		}

		.jcTime {
			text-align: right;
			margin-top: 10rpx;
			
			color: rgba(0, 0, 0, 0.45);
			font-size: 24rpx;
		}
	}
</style>